Python Reserved Characters

The following list shows reserved words in Python. These reserved words cannot be used as constants or variables, or any other identifier name. All Python keywords contain only lowercase letters

and exec not
assert finally or
break forpass
class from print
continue global raise
def if return
del import try
elif in while
else is with
except lambda yield

Python Arithmetic Operators

Operator Description Example
+ Addition> Adds values on either side of the operator a + b
- Subtraction Subtracts right hand operand from left hand operand a - b
* Multiplication Multiplies values on either side of the operator a * b
/ Division Divides left hand operand by right hand operand b / a
% Modulus Divides left hand operand by right hand operand and returns remainder b % a
** Exponent Performs exponential(power) calculation on operator a**b
// Floor Division it's used to conduct the floor division. It is used to find the floorof the quotient when first operand is divided by the second a // b

Python Comparison Operator

== If the values of two operands are equal, then the condition becomes true a == b is not true
!= If values of two operands are not equal, then condition becomes true a != b is true
<> If values of two operands are not equal, then condition becomes true a <> b is true. This is similar to != operator
> If the value of left operand is greater than the value of right operand, then condition become true a > b is not true
< If the value of left operand is less than the value of right operand, then condition becomes true a>b is true
>= If the value of left operand is greater than or equal tot he value of right operand, then condition becomes true a >= b is not true
If the value of left operand is less than or equal to the value of right operand, then condition becomes true a < = b is true

Python Assignment Operators

Operator Description Example
= Assigns values from right side operands to left side perand c = a + b, a + b into c
+= Add and It adds right operand to the left operand and assign the result to left operand c += a, c = c + a
-= Subtract and It subtracts right operand from the left operand and assign the result to left operand c -= a, c = c-a
*= Multiply and It multiplies right operand with the left operand and assign the result to left operand c *= a, c = c * a
/= Divide and It divides left operand with the right operand and assign the result to left operand c /= a, c = c / a
%= Modulus and t takes modulus using two operands and assign the result to left operand c %= a, c = c % a
**= Exponent and Performs exponential (power) calculation on operators and assign value to the left operand c **= a, c = c ** a
//= Floor division It performs floor division on operators and assign value to the left operand c //= a, c = c //a